package com.stanwind.dbselector.anno;

import static com.stanwind.dbselector.DBSelectorConstant.HINT_CUSTOM_PLACE_HOLDER;

/**
 * NodeType 节点类型
 *
 * @author : stan
 * @version : 1.0
 * @date :  2022/8/1 9:36 AM
 **/
public enum NodeType {
    /**
     * 强制主节点
     */
    MASTER(0, "FORCE_MASTER"),
    /**
     * 强制从节点
     */
    SLAVE(1, "FORCE_SLAVE"),
    /**
     * 强制指定节点
     */
    ASSIGN(2, "force_node='" + HINT_CUSTOM_PLACE_HOLDER + "'"),
    /**
     * 自定义hint
     */
    CUSTOM(3, HINT_CUSTOM_PLACE_HOLDER),
    /**
     * 忽略
     */
    IGNORE(4, ""),
    ;
    final int type;
    final String hint;

    NodeType(int type, String hint) {
        this.type = type;
        this.hint = hint;
    }

    public int getType() {
        return type;
    }

    public String getHint() {
        return hint;
    }
}
